/**
 * ...
 * @author Franco Ponticelli
 */

package uform.property;

import hxevents.Notifier;
import thx.util.Result;

class ReadPropertyDecorator<T> implements IReadProperty<T>
{
	public var onChange(getOnChange, null) : Notifier;
	public var validators(getValidators, null) : List<T -> Result>;
	
	var decorated : IProperty<T>;
	public function new(decorated : IProperty<T>)
	{
		this.decorated = decorated;
	}
	public function getOld()
	{
		return decorated.getOld();
	}
	public function get()
	{
		return decorated.get();
	}
	public function getValue()
	{
		return decorated.getValue();
	}
	public function getDefault()
	{
		return decorated.getDefault();
	}
	public function isNull()
	{
		return decorated.isNull();
	}
	public function hasValue()
	{
		return decorated.hasValue();
	}
	public function getAlt(alt : T)
	{
		return decorated.getAlt(alt);
	}
	
	public function isValid()
	{
		return decorated.isValid();
	}
	
	public function getMessages()
	{
		return decorated.getMessages();
	}
	
	function getOnChange()
	{
		return decorated.onChange;
	}
	
	function getValidators()
	{
		return decorated.validators;
	}
}